package com.cloudptt.api.product.func.call;

import com.cloudptt.api.product.log.Log;

public class CallTimer {
	public final static String THIS_FILE = "CallTimer";
	public final static int T180_DEFAULT = 60;
	private int c100 = 3;
	private int c101 = 3;
	private int c104 = 3;
	
	private int t100 = 1;//s
	private int t101 = 1;//s
	private int t103 = 10;//s
	private int t104 = 1;//s
	private int t132 = 1;//s
	private int t180 = T180_DEFAULT;//话权超时定时器

	private static CallTimer instance =  null;
	
	public static CallTimer getInstance()
	{
		if(instance == null)
		{
			instance = new CallTimer();
		}
		return instance;
	}
	private CallTimer()
	{}
	
//	public CallTimer(int t100,int t101,int t103,int t104,int t132,int t180)
//	{
//		this.t100 = t100;
//		this.t101 = t101;
//		this.t103 = t103;
//		this.t104 = t104;
//		this.t132 = t132;
//		this.t180 = t180;
//	}
	
//	public CallTime(int inactiveTimer,int memberSpeakTimer) {
//		this.inactiveTime = inactiveTimer;
//		this.memberSpeakTime = memberSpeakTimer;
//	}

	public void updateTime(CallTimer time) {
		Log.d(THIS_FILE, "updateTime CallTime = " + time);
		this.t100 = time.getT100();
		this.t101 = time.getT101();
		this.t103 = time.getT103();
		this.t104 = time.getT104();
		this.t132 = time.getT132();
		this.t180 = time.getT180();;
		time = null;
	}

	public void updateT180(int t180) {
		Log.d(THIS_FILE, "updateT180 t180 = " + t180);
		this.t180 = t180;;
	}
	
	public int getC100() {
		return c100;
	}

	public int getC101() {
		return c101;
	}

	public int getC104() {
		return c104;
	}
	
	public int getT100() {
		return t100;
	}

	public int getT101() {
		return t101;
	}

	public int getT103() {
		return t103;
	}

	public int getT104() {
		return t104;
	}

	public int getT132() {
		return t132;
	}

	public int getT180() { return t180; }
	
	public String toString() 
	{
		StringBuffer strBuff = new StringBuffer("CallTimer:");
		strBuff.append("c100 = ").append(c100).append(",");
		strBuff.append("c101 = ").append(c101).append(",");
		strBuff.append("c104 = ").append(c104).append(",");
		strBuff.append("t100 = ").append(t100).append(",");

		strBuff.append("t101 = ").append(t101).append(",");
		strBuff.append("t103 = ").append(t103).append(",");
		strBuff.append("t104 = ").append(t104).append(",");
		strBuff.append("t132 = ").append(t132).append(";");

		return strBuff.toString();
	}

}
